package com.itliang.service.hardware;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itliang.core.model.dto.equipment.EquipmentDataQueryRequest;
import com.itliang.core.model.entity.equipment.EquipmentData;
import com.itliang.core.model.entity.equipment.Statistics;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.Map;

/**
 * @author liangzhuoyuan
 * @description 针对表【equipment_data(数据表)】的数据库操作Service
 */
public interface EquipmentDataService extends IService<EquipmentData> {

    void insertMqttCollectionData(Map<String, EquipmentData> map);

    Page<EquipmentData> listEquipmentDataByPage(Page page, EquipmentDataQueryRequest equipmentDataQueryRequest);

    void exportEquipmentDataExcelByDataType(EquipmentDataQueryRequest queryRequest, HttpServletResponse response);

    /**
     * 把硬件数据存入数据库
     *
     * @param code
     * @param data
     * @param dataType
     * @param collectionTime
     */
    void insertHardData(String code, Double data, Integer dataType, Date collectionTime);

    Statistics getStatisticsData(Statistics statistics);
}
